// 封装所有和用户相关的接口函数
import request from '@/utils/http'

// export const loginAPI = ({ account, password }) => {
//   return request({
//     url: '/login',
//     method: 'POST',
//     data: {
//       account,
//       password
//     }
//   })
// }


export const getLikeListAPI = ({ limit = 4 }) => {
  return request({
    url: '/goods/relevant',
    params: {
      limit
    }
  })
}


export const UserLoginService = ({ username, password }) =>{
  setTimeout(()=>{
    console.log("登录",username,password)
  })
  return request.post('/login', { username, password })
}


export const UserRegisterService = ({ username, password }) => {
  return request.post('/register', { username, password })
}

// 获取用户信息
export const getUserInfoService = () =>{
  return request.get(`/account/info`)
}

//修改用户信息
export const updateUserInfoService = (data) =>{
  return request.put(`/account/info`, data)
}

//退出登录
export const logoutService = () =>{
  return request.get(`/logout`)
}